var DAO=require('./DAO')
//针对用户数据表操作的模块对象
var shopDAO = {
    getAllShop: function (callback) {
        DAO('select * from shop', null, function (err, results) {
            if (err) {
                callback(err, null)
            } else {
                callback(null, results)
            }
        })
    },
    getUserIdShop:function(userId,callback){
        DAO('select * from exchange where touserId = ?',[userId],function(err,results){
            if (err) {
                callback(err, null)
            } else {
                callback(null, results)
            }
        })
    }
}
module.exports=shopDAO